﻿
@{
    ViewBag.Title = "发表问题";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}

<div class="main layui-clear">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>发表问题</legend>
    </fieldset>
    <div class="layui-form layui-form-pane">
        <form method="post">
            @Html.AntiForgeryToken()
            <div class="layui-form-item">
                <label for="L_title" class="layui-form-label">标题</label>
                <div class="layui-input-block">
                    <input type="text" id="L_title" name="title" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <div class="layui-input-block">
                    <textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容" class="layui-textarea fly-editor" style="height: 260px;"></textarea>
                </div>
                <label for="L_content" class="layui-form-label" style="top: -2px;">描述</label>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">技术分类</label>
                    <div class="layui-input-block">
                        <select id="SkillKind" name="SkillKind" lay-filter="SkillKind" lay-search lay-verify="required">
                            <option value="">请搜索</option>
                            <option value="JapLang">日语</option>
                            <option value="PageSkill">前端开发语言</option>
                            <option value="ScriptLang">脚本开发语言</option>
                            <option value="HostLang">Host系开发语言</option>
                            <option value="OpenLang">Open系开发语言</option>
                            <option value="DBHSkill">Host系数据库</option>
                            <option value="DBOSkill">Open系数据库</option>
                            <option value="PhoneSkill">移动端</option>
                            <option value="OSSkill">操作系统</option>
                            <option value="ServerSkill">Web服务器</option>
                            <option value="ReportSkill">报表(帐票)</option>
                            <option value="DBLink">DB链接</option>
                            <option value="OtherLang">其他开发语言</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">技术名称</label>
                    <div class="layui-input-block">
                        <select id="SkillName" name="SkillName">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">悬赏积分</label>
                    <div class="layui-input-block" style="width:80px">
                        <select name="reward">
                            <option value="5" selected>5</option>
                            <option value="20">20</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-normal" lay-filter="*" lay-submit>立即发布</button>
            </div>
        </form>
    </div>
</div>
@section scripts{
    <script>
        layui.use(['jquery', 'form','common'], function () {
            var $ = layui.jquery;
            var form = layui.form;
            var com = layui.common;
            form.on('select(SkillKind)', function (data) {
                if (data.value != "JapLang") {
                    com.getOption(data.value, "SkillName");
                } else {
                    var html1 = '<dd lay-value="" >' + "请选择" + '</dd>';
                    var html2 = '<option value="" >' + "请选择" + '</option>';
                    $("#SkillName").next().children().eq(1).html(html1);
                    $("#SkillName").html(html2);
                    form.render();
                }
            });
        });
    </script>
}

